import 'package:safetymonitor/generated/json/base/json_convert_content.dart';
import 'package:safetymonitor/app/data/entities/application/preventive_rectification_create_entity.dart';

PreventiveRectificationCreateEntity $PreventiveRectificationCreateEntityFromJson(Map<String, dynamic> json) {
  final PreventiveRectificationCreateEntity preventiveRectificationCreateEntity = PreventiveRectificationCreateEntity();
  final String? preventiveName = jsonConvert.convert<String>(json['preventiveName']);
  if (preventiveName != null) {
    preventiveRectificationCreateEntity.preventiveName = preventiveName;
  }
  final int? companyId = jsonConvert.convert<int>(json['companyId']);
  if (companyId != null) {
    preventiveRectificationCreateEntity.companyId = companyId;
  }
  final int? rectificationPersonId = jsonConvert.convert<int>(json['rectificationPersonId']);
  if (rectificationPersonId != null) {
    preventiveRectificationCreateEntity.rectificationPersonId = rectificationPersonId;
  }
  final String? rectificationPersonIdName = jsonConvert.convert<String>(json['rectificationPersonIdName']);
  if (rectificationPersonIdName != null) {
    preventiveRectificationCreateEntity.rectificationPersonIdName = rectificationPersonIdName;
  }
  final int? findTime = jsonConvert.convert<int>(json['findTime']);
  if (findTime != null) {
    preventiveRectificationCreateEntity.findTime = findTime;
  }
  final int? rectificationDeadline = jsonConvert.convert<int>(json['rectificationDeadline']);
  if (rectificationDeadline != null) {
    preventiveRectificationCreateEntity.rectificationDeadline = rectificationDeadline;
  }
  final String? source = jsonConvert.convert<String>(json['source']);
  if (source != null) {
    preventiveRectificationCreateEntity.source = source;
  }
  final String? problemDesc = jsonConvert.convert<String>(json['problemDesc']);
  if (problemDesc != null) {
    preventiveRectificationCreateEntity.problemDesc = problemDesc;
  }
  final String? rectificationRequire = jsonConvert.convert<String>(json['rectificationRequire']);
  if (rectificationRequire != null) {
    preventiveRectificationCreateEntity.rectificationRequire = rectificationRequire;
  }
  final String? fileUrl = jsonConvert.convert<String>(json['fileUrl']);
  if (fileUrl != null) {
    preventiveRectificationCreateEntity.fileUrl = fileUrl;
  }
  final String? companyName = jsonConvert.convert<String>(json['companyName']);
  if (companyName != null) {
    preventiveRectificationCreateEntity.companyName = companyName;
  }
  final bool? isHead = jsonConvert.convert<bool>(json['isHead']);
  if (isHead != null) {
    preventiveRectificationCreateEntity.isHead = isHead;
  }
  final String? deptNames = jsonConvert.convert<String>(json['deptNames']);
  if (deptNames != null) {
    preventiveRectificationCreateEntity.deptNames = deptNames;
  }
  final String? deptIds = jsonConvert.convert<String>(json['deptIds']);
  if (deptIds != null) {
    preventiveRectificationCreateEntity.deptIds = deptIds;
  }
  final String? responsibleUserNames = jsonConvert.convert<String>(json['responsibleUserNames']);
  if (responsibleUserNames != null) {
    preventiveRectificationCreateEntity.responsibleUserNames = responsibleUserNames;
  }
  final String? responsibleUsers = jsonConvert.convert<String>(json['responsibleUsers']);
  if (responsibleUsers != null) {
    preventiveRectificationCreateEntity.responsibleUsers = responsibleUsers;
  }
  final String? rectificationDeptIds = jsonConvert.convert<String>(json['rectificationDeptIds']);
  if (rectificationDeptIds != null) {
    preventiveRectificationCreateEntity.rectificationDeptIds = rectificationDeptIds;
  }
  final String? rectificationDeptNames = jsonConvert.convert<String>(json['rectificationDeptNames']);
  if (rectificationDeptNames != null) {
    preventiveRectificationCreateEntity.rectificationDeptNames = rectificationDeptNames;
  }
  final String? rectificationUserIds = jsonConvert.convert<String>(json['rectificationUserIds']);
  if (rectificationUserIds != null) {
    preventiveRectificationCreateEntity.rectificationUserIds = rectificationUserIds;
  }
  final String? rectificationUserNames = jsonConvert.convert<String>(json['rectificationUserNames']);
  if (rectificationUserNames != null) {
    preventiveRectificationCreateEntity.rectificationUserNames = rectificationUserNames;
  }
  return preventiveRectificationCreateEntity;
}

Map<String, dynamic> $PreventiveRectificationCreateEntityToJson(PreventiveRectificationCreateEntity entity) {
  final Map<String, dynamic> data = <String, dynamic>{};
  data['preventiveName'] = entity.preventiveName;
  data['companyId'] = entity.companyId;
  data['rectificationPersonId'] = entity.rectificationPersonId;
  data['rectificationPersonIdName'] = entity.rectificationPersonIdName;
  data['findTime'] = entity.findTime;
  data['rectificationDeadline'] = entity.rectificationDeadline;
  data['source'] = entity.source;
  data['problemDesc'] = entity.problemDesc;
  data['rectificationRequire'] = entity.rectificationRequire;
  data['fileUrl'] = entity.fileUrl;
  data['companyName'] = entity.companyName;
  data['isHead'] = entity.isHead;
  data['deptNames'] = entity.deptNames;
  data['deptIds'] = entity.deptIds;
  data['responsibleUserNames'] = entity.responsibleUserNames;
  data['responsibleUsers'] = entity.responsibleUsers;
  data['rectificationDeptIds'] = entity.rectificationDeptIds;
  data['rectificationDeptNames'] = entity.rectificationDeptNames;
  data['rectificationUserIds'] = entity.rectificationUserIds;
  data['rectificationUserNames'] = entity.rectificationUserNames;
  return data;
}

extension PreventiveRectificationCreateEntityExtension on PreventiveRectificationCreateEntity {
  PreventiveRectificationCreateEntity copyWith({
    String? preventiveName,
    int? companyId,
    int? rectificationPersonId,
    String? rectificationPersonIdName,
    int? findTime,
    int? rectificationDeadline,
    String? source,
    String? problemDesc,
    String? rectificationRequire,
    String? fileUrl,
    String? companyName,
    bool? isHead,
    String? deptNames,
    String? deptIds,
    String? responsibleUserNames,
    String? responsibleUsers,
    String? rectificationDeptIds,
    String? rectificationDeptNames,
    String? rectificationUserIds,
    String? rectificationUserNames,
  }) {
    return PreventiveRectificationCreateEntity()
      ..preventiveName = preventiveName ?? this.preventiveName
      ..companyId = companyId ?? this.companyId
      ..rectificationPersonId = rectificationPersonId ?? this.rectificationPersonId
      ..rectificationPersonIdName = rectificationPersonIdName ?? this.rectificationPersonIdName
      ..findTime = findTime ?? this.findTime
      ..rectificationDeadline = rectificationDeadline ?? this.rectificationDeadline
      ..source = source ?? this.source
      ..problemDesc = problemDesc ?? this.problemDesc
      ..rectificationRequire = rectificationRequire ?? this.rectificationRequire
      ..fileUrl = fileUrl ?? this.fileUrl
      ..companyName = companyName ?? this.companyName
      ..isHead = isHead ?? this.isHead
      ..deptNames = deptNames ?? this.deptNames
      ..deptIds = deptIds ?? this.deptIds
      ..responsibleUserNames = responsibleUserNames ?? this.responsibleUserNames
      ..responsibleUsers = responsibleUsers ?? this.responsibleUsers
      ..rectificationDeptIds = rectificationDeptIds ?? this.rectificationDeptIds
      ..rectificationDeptNames = rectificationDeptNames ?? this.rectificationDeptNames
      ..rectificationUserIds = rectificationUserIds ?? this.rectificationUserIds
      ..rectificationUserNames = rectificationUserNames ?? this.rectificationUserNames;
  }
}